The main php file :
-------------------


1. Add this code at the begining of the php file

<?php

if (file_exists("./FOLDER_NAME/newtexture.jpg")) { 
   unlink("./FOLDER_NAME/newtexture.jpg"); 
} 
?>



2. Add this code under the meta <title>

<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<style type="text/css">
<!--
body {
	background-color: #FFFFFF;
}
-->
</style>



3. Add this code under the Wirefusion code

<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','262','height','50','src','fileUpload','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','fileUpload' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="262" height="50">
  <param name="movie" value="fileUpload.swf" />
  <param name="quality" value="high" />
  <embed src="fileUpload.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="262" height="50"></embed>
</object></noscript><br><br>

__________________________
__________________________


The upload.php file :
---------------------


This is the code of the upload.php file

<?php if (isset($_FILES['Filedata']['name'])) {

$uploadDir = "./FOLDER_NAME/";
$tmp_name = $_FILES['fichier']['tmp_name'];
$name = 'newtexture.jpg';
$uploadFile = $uploadDir . basename($_FILES['Filedata']['name']);
move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadDir.'/'.$name);
}  ?>